<template>
    <div>
       <ul>
           <li v-for="(item,key) in listArr">
               <router-link :to="'/getvalue/' + item.aid">{{key}}{{item.title}}</router-link>
           </li>
       </ul>
    
    </div>
</template>

<script>
export default {
    data(){
        return{
            msg:'list news',
            listArr:[]
        }
    },
    methods:{
      requestData(){
        //   jsonp请求的话  后台api接口要支持jsonp
        let api = 'http://www.phonegap100.com/appapi.php?a=getPortalList&catid=20&page=1';
          this.$http.jsonp(api).then((response) =>{
              console.log(response);
            //   用到this要注意this的指向
            this.listArr = response.body.result;
          },function(err){
              console.log(err);
          });
      }
    },
    mounted(){
        // 请求数据
     this.requestData();
    }
}
</script>

<style lang="scss" scoped>

</style>
